<script setup lang="ts">
//故事表格
import BG from "@/assets/one.jpg";
import BT from "@/assets/two.jpg";
</script>
<template>
  <ul class="section-tiles">
    <li class="tile-item item-hero-highlight">
      <a class="tile tile-hero-highlight medium-load small-load large-loaded">
        <!--背景图-->
        <div class="tile__media">
          <div class="image"><img :src="BG" /></div>
        </div>
        <!--标题-->
        <div class="tile__gradient">
          <div class="tile__description">
            <div class="tile__head">
              <div class="tile__category pill pill-accent3">创作者</div>
              <div class="tile__headline">
                中国用户依托 iPad 与 Apple Pencil
                的强大功能，拓展书法、手账与电子笔记的创意边界
              </div>
            </div>
            <div class="tile__timestamp icon-hide icon icon-before icon-clock">
              2023 年 8 月 10 日
            </div>
          </div>
        </div>
      </a>
    </li>
    <li class="tile-item item-3up" v-for="n in 3" :key="n">
      <a class="tile tile-3up tile-expands has-gradient-secondary">
        <picture class="viewport-picture">
          <img class="viewport-image" :src="BT" />
        </picture>
        <div class="tile__gradient-secondary">
          <div class="tile__description">
            <div class="tile__head">
              <div class="tile__category pill pill-accent3">创作者</div>

              <div class="tile__headline">全新沉浸式 AR app 助学生实现创意</div>
            </div>

            <div class="tile__timestamp icon-hide icon icon-before icon-clock">
              2023 年 7 月 5 日
            </div>
          </div>
        </div>
      </a>
    </li>
  </ul>
</template>
<style scoped lang="less">
.section-tiles {
  align-items: stretch;
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  margin: 0;
  margin-top: 0px;
}
.tile-item {
  position: relative;
  list-style: none;
}

.stories-module .section-tiles {
  margin-top: 52px;
  width: 100%;
}
.tile {
  background-color: #fff;
  display: flex;
  border-radius: 16px;
  overflow: hidden;
  z-index: 0;
  position: relative;
  .tile__description {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    flex-grow: 1;
  }
  .tile__description {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    flex-grow: 1;
  }
}
.tile__media {
  position: relative;
  z-index: 0;
  flex-grow: 0;
  flex-shrink: 0;
  overflow: hidden;
}
.tile__category {
  font-size: 12px;
  line-height: 1.33337;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Helvetica",
    "Arial", sans-serif;
}
.pill-accent3 {
  background-color: #d28314;
}
.pill {
  border-radius: 16px;
  display: inline-block;
  padding: 2px 6px;
  text-transform: uppercase;
}
.tile.tile-hero-highlight {
  display: block;
  justify-content: flex-end;
  position: relative;
  .tile__media {
    width: 980px;
    height: 551px;
  }
  .tile__gradient {
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: 0;
    z-index: 0;
  }
  .tile__gradient::before {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 250%;
    z-index: 0;
    background-size: 100.1% 100.1%;
  }
  .tile__gradient::before {
    bottom: 0;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.8),
      rgba(0, 0, 0, 0.77311) 12.83%,
      rgba(0, 0, 0, 0.72685) 24%,
      rgba(0, 0, 0, 0.66487) 33.77%,
      rgba(0, 0, 0, 0.59081) 42.37%,
      rgba(0, 0, 0, 0.50831) 50.07%,
      rgba(0, 0, 0, 0.421) 57.13%,
      rgba(0, 0, 0, 0.33252) 63.78%,
      rgba(0, 0, 0, 0.24652) 70.3%,
      rgba(0, 0, 0, 0.16663) 76.92%,
      rgba(0, 0, 0, 0.09648) 83.91%,
      rgba(0, 0, 0, 0.03973) 91.52%,
      rgba(0, 0, 0, 0)
    );
  }

  .tile__description {
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
  }
  .tile__description {
    padding: 0 36px 36px;
  }
  .tile__category {
    margin-bottom: 12px;
  }
  .tile__headline,
  .tile__category,
  .tile__timestamp {
    color: #fff;
  }
  .tile__headline {
    font-size: 40px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: 0em;
    font-family: "SF Pro Display", "SF Pro Icons", "Helvetica Neue", "Helvetica",
      "Arial", sans-serif;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
  }
  .tile__timestamp {
    margin-top: 12px;
  }
}
.tile__timestamp {
  font-size: 14px;
  line-height: 1.28577;
  font-weight: 600;
  letter-spacing: -0.016em;
  font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Helvetica",
    "Arial", sans-serif;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.tile.tile {
  height: 100%;
}

//三个块
.tile-item:first-child.item-hero-highlight ~ .tile-item {
  margin-top: 36px;
}
.tile-3up.has-gradient-secondary {
  display: block;
  justify-content: flex-end;
  position: relative;
  background-color: #000;
  display: flex;
  justify-content: flex-end;
  min-height: 314px;
  .viewport-picture {
    z-index: 0;
    display: flex;
    overflow: hidden;
    position: absolute;
    top: 0;
    width: 100%;
    img {
      width: 100%;
    }
  }
  .viewport-picture::before {
    content: "";
    max-height: 236px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 100%);
    height: 100%;
    bottom: 0;
    z-index: 1;

    position: absolute;
    left: 0;
    width: 100%;
  }
  .tile__gradient-secondary {
    display: flex;
    height: 100%;
    margin-top: auto;
    width: 100%;
  }
  .tile__description {
    height: auto;
    justify-content: flex-end;
    margin-top: 0;
  }
  .tile__description {
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
  }
  .tile__headline,
  .tile__category,
  .tile__timestamp {
    color: #fff;
  }
  .tile__headline {
    font-size: 19px;
    line-height: 1.21053;
    font-weight: 700;
    letter-spacing: 0.012em;
    font-family: "SF Pro Display", "SF Pro Icons", "Helvetica Neue", "Helvetica",
      "Arial", sans-serif;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
  }
}
.tile-3up {
  flex-direction: column;
  width: 303px;
  .tile__description {
    padding: 24px;
    justify-content: space-between;
    flex-basis: auto;
  }
  .tile__category {
    margin-bottom: 8px;
  }
  .tile__timestamp {
    margin-top: 8px;
  }
}
.tile-3up.has-gradient-secondary.tile-expands {
  .tile__description {
    min-height: 152px;
  }
  .tile__gradient-secondary {
    margin-top: calc(100% - 152px);
  }
}
.tile__category {
  font-size: 12px;
  line-height: 1.33337;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Helvetica",
    "Arial", sans-serif;
}
</style>
